package com.lcm.learn.lcmcode.collection;

import java.util.*;

/**
 * @description:
 * @author: lcm
 * @create: 2019-12-13 14:50
 **/

public class HashMapTest {

    public static void main(String[] args){
        test1();
    }

    public static void test1(){
        Integer integer=new Integer(1);
        integer.hashCode();
        HashMap map=new HashMap(8);
        map.put(9,9);
        for(int i=0;i<100;i++){
            map.put(i,i);
        }
    }

    public static void test(){
        LinkedHashMap linkedHashMap=new LinkedHashMap(16,0.75f,true);
        HashMap map=new HashMap(16,0.75f);
        for(int i=0;i<10;i++){
            map.put(i,i);
            linkedHashMap.put(i,i);
        }
        System.out.println(map.get(1));
        System.out.println(linkedHashMap.get(1));

        System.out.println(map);
        System.out.println(linkedHashMap);

        map.put(10,10);
        linkedHashMap.put(10,10);

        System.out.println(map);
        System.out.println(linkedHashMap);


        HashSet set=new HashSet();

        LinkedHashSet linkedHashSet=new LinkedHashSet();

        //非数字
//        Float v= 0.0f / 0.0f;
//        float v1= 0.0f;
//        System.out.println(Float.isNaN(v));
//        System.out.println((v != v));
//
//        System.out.println(Float.isNaN(v1));
//        System.out.println((v1 != v1));

        Map synchronizedMap = Collections.synchronizedMap(map);
    }
}
